<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      sendmail-8.15.2
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-2020-04-02">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 2020-04-02
      </h4>
      <h3>
        Chapter&nbsp;21.&nbsp;Mail Server Software
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="postfix.html" title="Postfix-3.5.0">Prev</a>
          <p>
            Postfix-3.5.0
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="databases.html" title="Databases">Next</a>
          <p>
            Databases
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="mail.html" title=
          "Chapter&nbsp;21.&nbsp;Mail Server Software">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="sendmail" name="sendmail"></a>sendmail-8.15.2
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to sendmail
        </h2>
        <p>
          The <span class="application">sendmail</span> package contains a
          Mail Transport Agent (MTA).
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (FTP): <a class="ulink" href=
                "ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.15.2.tar.gz">ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.15.2.tar.gz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: a824fa7dea4d3341efb6462ccd816f00
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 2.1 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 14 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.2 SBU
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Additional Downloads
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Required patch: <a class="ulink" href=
                "http://www.linuxfromscratch.org/patches/blfs/svn/sendmail.8.15.2-openssl-1.patch">
                http://www.linuxfromscratch.org/patches/blfs/svn/sendmail.8.15.2-openssl-1.patch</a>
              </p>
            </li>
          </ul>
        </div>
        <h3>
          sendmail Dependencies
        </h3>
        <h4>
          Required
        </h4>
        <p class="required">
          <a class="xref" href="openldap.html" title=
          "OpenLDAP-2.4.49">OpenLDAP-2.4.49</a> (client)
        </p>
        <h4>
          Recommended
        </h4>
        <p class="recommended">
          <a class="xref" href="../postlfs/cyrus-sasl.html" title=
          "Cyrus SASL-2.1.27">Cyrus SASL-2.1.27</a>
        </p>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="../pst/gs.html" title=
          "ghostscript-9.52">ghostscript-9.52</a> (for creating PDF
          documentation), <a class="xref" href="../basicnet/procmail.html"
          title="Procmail-3.22">Procmail-3.22</a> (the configuration proposed
          below requires that <span class=
          "command"><strong>procmail</strong></span> be present at run-time),
          and <a class="ulink" href="https://github.com/chaos/nph">nph</a>
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/sendmail">http://wiki.linuxfromscratch.org/blfs/wiki/sendmail</a>
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of sendmail
        </h2>
        <p>
          Before building <span class="application">sendmail</span>, create
          the required user, group and directory with the following commands
          issued as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class=
"command">groupadd -g 26 smmsp                               &amp;&amp;
useradd -c "Sendmail Daemon" -g smmsp -d /dev/null \
        -s /bin/false -u 26 smmsp                  &amp;&amp;
chmod -v 1777 /var/mail                            &amp;&amp;
install -v -m700 -d /var/spool/mqueue</kbd>
</pre>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            See the source tree <code class="filename">sendmail/README</code>
            file for information on linking optional packages into the build.
            Use the example below, which adds support for SASL, StartTLS
            (<span class="application">OpenSSL</span>) and <span class=
            "application">OpenLDAP</span>, as a starting point. Of course,
            modify it to suit your particular needs.
          </p>
        </div>
        <pre class="userinput">
<kbd class="command">cat &gt;&gt; devtools/Site/site.config.m4 &lt;&lt; "EOF"
<code class="literal">APPENDDEF(`confENVDEF',`-DSTARTTLS -DSASL -DLDAPMAP')
APPENDDEF(`confLIBS', `-lssl -lcrypto -lsasl2 -lldap -llber -ldb')
APPENDDEF(`confINCDIRS', `-I/usr/include/sasl')</code>
EOF</kbd>
</pre>
        <p>
          Install <span class="application">sendmail</span> with the
          following commands:
        </p>
        <pre class="userinput">
<kbd class=
"command">patch -Np1 -i ../sendmail.8.15.2-openssl-1.patch &amp;&amp;

cat &gt;&gt; devtools/Site/site.config.m4 &lt;&lt; "EOF"
<code class="literal">define(`confMANGRP',`root')
define(`confMANOWN',`root')
define(`confSBINGRP',`root')
define(`confUBINGRP',`root')
define(`confUBINOWN',`root')</code>
EOF

sed -i 's|/usr/man/man|/usr/share/man/man|' \
    devtools/OS/Linux           &amp;&amp;

cd sendmail                     &amp;&amp;
sh Build                        &amp;&amp;
cd ../cf/cf                     &amp;&amp;
cp generic-linux.mc sendmail.mc &amp;&amp;
sh Build sendmail.cf</kbd>
</pre>
        <p>
          This package does not come with a test suite.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">install -v -d -m755 /etc/mail &amp;&amp;
sh Build install-cf &amp;&amp;

cd ../..            &amp;&amp;
sh Build install    &amp;&amp;

install -v -m644 cf/cf/{submit,sendmail}.mc /etc/mail &amp;&amp;
cp -v -R cf/* /etc/mail                               &amp;&amp;

install -v -m755 -d /usr/share/doc/sendmail-8.15.2/{cf,sendmail} &amp;&amp;

install -v -m644 CACerts FAQ KNOWNBUGS LICENSE PGPKEYS README RELEASE_NOTES \
        /usr/share/doc/sendmail-8.15.2 &amp;&amp;

install -v -m644 sendmail/{README,SECURITY,TRACEFLAGS,TUNING} \
        /usr/share/doc/sendmail-8.15.2/sendmail &amp;&amp;

install -v -m644 cf/README /usr/share/doc/sendmail-8.15.2/cf &amp;&amp;

for manpage in sendmail editmap mailstats makemap praliases smrsh
do
    install -v -m644 $manpage/$manpage.8 /usr/share/man/man8
done &amp;&amp;

install -v -m644 sendmail/aliases.5    /usr/share/man/man5 &amp;&amp;
install -v -m644 sendmail/mailq.1      /usr/share/man/man1 &amp;&amp;
install -v -m644 sendmail/newaliases.1 /usr/share/man/man1 &amp;&amp;
install -v -m644 vacation/vacation.1   /usr/share/man/man1</kbd>
</pre>
        <p>
          Install the <span class="application">sendmail</span> Installation
          and Operations Guide with the following commands:
        </p>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            Remove <code class="filename">op.pdf</code> from the <span class=
            "command"><strong>make</strong></span> and <span class=
            "command"><strong>install</strong></span> commands below if you
            don't have <span class="application">Ghostscript</span>
            installed.
          </p>
        </div>
        <pre class="userinput">
<kbd class=
"command">cd doc/op                                       &amp;&amp;
sed -i 's/groff/GROFF_NO_SGR=1 groff/' Makefile &amp;&amp;
make op.txt op.pdf</kbd>
</pre>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class=
"command">install -v -d -m755 /usr/share/doc/sendmail-8.15.2 &amp;&amp;
install -v -m644 op.ps op.txt op.pdf /usr/share/doc/sendmail-8.15.2 &amp;&amp;
cd ../..</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <span class="command"><strong>cat &gt; devtools/Site/site.config.m4
          &lt;&lt; "EOF"</strong></span>: This creates a configuration file
          changing some of the default settings.
        </p>
        <p>
          <span class="command"><strong>sed ...
          devtools/OS/Linux</strong></span>: The site.config.m4 does not
          honor a change to the man directory, so fix it in the OS
          definitions.
        </p>
        <p>
          <span class="command"><strong>sed ...
          include/sm/bdb.h</strong></span>: This allows sendmail to build
          properly with <a class="xref" href="db.html" title=
          "Berkeley DB-5.3.28">Berkeley DB-5.3.28</a> versions 5 and above.
        </p>
        <p>
          <span class="command"><strong>sh Build; sh Build sendmail.cf; sh
          Build install-cf; sh Build install</strong></span>: <span class=
          "application">sendmail</span> uses an <span class=
          "application">m4</span> based build script to create the various
          <code class="filename">Makefile</code>s. These commands build and
          install the package.
        </p>
        <p>
          <span class="command"><strong>for manpage in...;do...;done; install
          ...</strong></span>: The man pages are installed already formatted
          and <span class="command"><strong>man</strong></span> displays them
          somewhat garbled. These commands replace the formatted pages with
          pages <span class="command"><strong>man</strong></span> can display
          properly.
        </p>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring sendmail
        </h2>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="sendmail-config" name="sendmail-config"></a>
          </h3>
          <h4 class="title">
            <a id="sendmail-config" name="sendmail-config"></a>Config Files
          </h4>
          <p>
            <code class="filename">/etc/mail/*</code>
          </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3"></h3>
          <h4 class="title">
            <a id="idm140006437056368" name=
            "idm140006437056368"></a>Configuration Information
          </h4>
          <div class="admon note">
            <img alt="[Note]" src="../images/note.png" />
            <h3>
              Note
            </h3>
            <p>
              Ensure you have a fully qualified domain name defined in
              <code class="filename">/etc/hosts</code> for your system before
              proceeding.
            </p>
          </div>
          <p>
            Create the <code class=
            "filename">/etc/mail/local-host-names</code> and <code class=
            "filename">/etc/mail/aliases</code> files using the following
            commands as the <code class="systemitem">root</code> user:
          </p>
          <pre class="root">
<kbd class="command">echo $(hostname) &gt; /etc/mail/local-host-names
cat &gt; /etc/mail/aliases &lt;&lt; "EOF"
<code class="literal">postmaster: root
MAILER-DAEMON: root</code>

EOF
newaliases</kbd>
</pre>
          <p>
            <span class="application">sendmail</span>'s primary configuration
            file, <code class="filename">/etc/mail/sendmail.cf</code>, is
            complex and not meant to be directly edited. The recommended
            method for changing it is to modify <code class=
            "filename">/etc/mail/sendmail.mc</code> and various <span class=
            "application">m4</span> files, then run the <span class=
            "command"><strong>m4</strong></span> macro processor from within
            <code class="filename">/etc/mail</code> as follows:
          </p>
          <pre class="root">
<kbd class="command">cd /etc/mail &amp;&amp;
m4 m4/cf.m4 sendmail.mc &gt; sendmail.cf</kbd>
</pre>
          <p>
            A full explanation of the files to modify, and the available
            parameters can be found in <code class=
            "filename">/etc/mail/README</code>.
          </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="sendmail-init" name="sendmail-init"></a>
          </h3>
          <h4 class="title">
            <a id="sendmail-init" name="sendmail-init"></a><span class=
            "phrase">Boot Script</span>
          </h4>
          <p>
            To automate the running of <span class=
            "application">sendmail</span> at startup, install the
            <span class="phrase"><code class=
            "filename">/etc/rc.d/init.d/sendmail</code> init script</span>
            included in the <a class="xref" href=
            "../introduction/bootscripts.html" title=
            "BLFS Boot Scripts">blfs-bootscripts-20191204</a> package:
          </p>
          <pre class="root">
<kbd class="command">make install-sendmail</kbd>
</pre>
          <div class="admon note">
            <img alt="[Note]" src="../images/note.png" />
            <h3>
              Note
            </h3>
            <p>
              The -qNm option to <span class=
              "command"><strong>sendmail</strong></span>, where N is number
              of minutes, controls how often <span class=
              "application">sendmail</span> will process the mail queue. A
              default of 5 minutes is used in the <span class="phrase">init
              script.</span> Individual workstation users may want to set
              this as low as 1 minute, large installations handling more mail
              may want to set it higher.
            </p>
          </div>
        </div>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">editmap, mailstats, makemap, praliases,
              sendmail, smrsh, and vacation; symlinks to /usr/sbin/sendmail:
              hoststat, mailq, newaliases, and purgestat</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">None</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/etc/mail,
              /usr/share/doc/sendmail-8.15.2, /var/spool/mqueue, and
              /var/spool/clientmqueue</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="editmap" name="editmap"></a><span class=
                    "term"><span class=
                    "command"><strong>editmap</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    queries and edits <span class=
                    "application">sendmail</span> map files.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="hoststat" name="hoststat"></a><span class=
                    "term"><span class=
                    "command"><strong>hoststat</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    prints <span class="application">sendmail</span>'s
                    persistent host status.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="mailstats" name="mailstats"></a><span class=
                    "term"><span class=
                    "command"><strong>mailstats</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    displays <span class="application">sendmail</span>
                    statistics.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="mailq-sendmail" name=
                    "mailq-sendmail"></a><span class="term"><span class=
                    "command"><strong>mailq</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    prints a summary of outbound mail messages waiting for
                    delivery.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="makemap" name="makemap"></a><span class=
                    "term"><span class=
                    "command"><strong>makemap</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    creates <span class="application">sendmail</span> map
                    files.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="newaliases-sendmail" name=
                    "newaliases-sendmail"></a><span class="term"><span class=
                    "command"><strong>newaliases</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    rebuilds <code class=
                    "filename">/etc/mail/aliases.db</code> from the contents
                    of <code class="filename">/etc/mail/aliases</code>.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="praliases" name="praliases"></a><span class=
                    "term"><span class=
                    "command"><strong>praliases</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    displays current <span class=
                    "application">sendmail</span> aliases.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="purgestat" name="purgestat"></a><span class=
                    "term"><span class=
                    "command"><strong>purgestat</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    causes <span class="application">sendmail</span> to clear
                    (purge) all its host-status information.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="sendmail-prog-sendmail" name=
                    "sendmail-prog-sendmail"></a><span class=
                    "term"><span class=
                    "command"><strong>sendmail</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the <span class="application">sendmail</span> mail
                    transport agent.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="smrsh" name="smrsh"></a><span class=
                    "term"><span class=
                    "command"><strong>smrsh</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a restricted shell for <span class=
                    "application">sendmail</span>.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="vacation-sendmail" name=
                    "vacation-sendmail"></a><span class="term"><span class=
                    "command"><strong>vacation</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is an email auto responder.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-03-07 03:40:50 -0600
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="postfix.html" title="Postfix-3.5.0">Prev</a>
          <p>
            Postfix-3.5.0
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="databases.html" title="Databases">Next</a>
          <p>
            Databases
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="mail.html" title=
          "Chapter&nbsp;21.&nbsp;Mail Server Software">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
